package org.eclipse.emf.extensions.microsoft;

import org.eclipse.emf.extensions.DBTypeProvider;

public class MicrosoftTypeProvider extends DBTypeProvider {
    public static final MicrosoftTypeProvider INSTANCE=new MicrosoftTypeProvider();

    private MicrosoftTypeProvider() {
    }

    @Override
    public String getStringType() {
        return "NCHAR(256)"; //$NON-NLS-1$
    }

    @Override
    public String getBooleanType() {
        return "BIT"; //$NON-NLS-1$
    }

    @Override
    public String getIntType() {
        return "INT"; //$NON-NLS-1$
    }

    @Override
    public String getLongType() {
        return "BIGINT"; //$NON-NLS-1$
    }

    @Override
    public String getDoubleType() {
        return "FLOAT"; //$NON-NLS-1$
    }

    @Override
    public String getFloatType() {
        return "FLOAT"; //$NON-NLS-1$
    }

    @Override
    public String getByteArrayType() {
        return "BINARY"; //$NON-NLS-1$
    }

    @Override
    public String getDateType() {
        return "DATETIME"; //$NON-NLS-1$
    }

    @Override
    public String getClassNameType() {
        return "NCHAR(256)"; //$NON-NLS-1$
    }

    @Override
    public String replace(String columnTypeAnnotation) {
        if ("DATE".equalsIgnoreCase(columnTypeAnnotation)) //$NON-NLS-1$
            return getDateType();

        return super.replace(columnTypeAnnotation);
    }
}
